<template>
    <div>
        <h3>{{photoinfo.username}}</h3>
        <p class="subtitle">
            <span>时间：{{photoinfo.passtime}}</span>
            <span>点击：{{photoinfo.down}}次</span>
        </p>
        <hr>
        <!-- 缩略图 -->
        <vue-preview :slides="slide1" @close="handleClose"></vue-preview>
         <!-- <img class="preview-img" v-for="(item, index) in list" :src="item.src" height="100" @click="$preview.open(index, list)">    -->
        <!-- 图片内筒 -->
        <div class="content">{{photoinfo.text}}</div>

        <!-- 评论 -->
        <cmt-box></cmt-box>
    </div>
</template>
<script>
import comment from '../subcomponents/comment.vue'


export default {
    data() {
        return {
            photoinfo:{},
            id:this.$route.params.forward,
             slide1: [
          {
            src: 'https://farm6.staticflickr.com/5591/15008867125_68a8ed88cc_b.jpg',
            msrc: 'https://farm6.staticflickr.com/5591/15008867125_68a8ed88cc_m.jpg',
            alt: 'picture1',
            title: 'Image Caption 1',
            w: 600,
            h: 400
          },
          {
            src: 'https://farm4.staticflickr.com/3902/14985871946_86abb8c56f_b.jpg',
            msrc: 'https://farm4.staticflickr.com/3902/14985871946_86abb8c56f_m.jpg',
            alt: 'picture2',
            title: 'Image Caption 2',
            w: 1200,
            h: 900
          }
        ]
        }
    },
    created() {
        this.getphotoinfo()
        // this.getthumbs()
    },
    methods: {
        getphotoinfo(){
            this.$http.get("satinGodApi?type=5&page=1").then(result=>{
                  if(result.body.code===200){
                    console.log(result.body);
                    
                    this.photoinfo=result.body.data[0];
                }
            })
        },
        getthumbs(){
            this.$http.get('url'+this.id).then(result=>{
                if(result.body.code===0){
                   result.body.message.forEach(item=>{
                       item.w=600;
                       item.h=400;
                   })
                   this.list=result.body.message
                }
            })
        },
        handleClose () {
        console.log('close event')
      }
    },
    components:{
        'cmt-box':comment
    }
}
</script>
<style lang="less">

</style>
